package controller.command;


import javafx.scene.paint.Color;
import model.displayer.ShapeDisplayer;
import model.displayer.TextDisplayer;

import java.util.Iterator;


public class CommandFactory
{
    private CommandFactory(){};

    private static class SingleTon{
        private static CommandFactory instance = new CommandFactory();
    }

    public static CommandFactory getInstance()
    {
        return SingleTon.instance;
    }

    public ShapeShowCmd getShowCmd(ShapeDisplayer shape)
    {
        return new ShapeShowCmd(shape);
    }

    public ShapeClearCmd getClearCmd(ShapeDisplayer shape)
    {
        return new ShapeClearCmd(shape);
    }

    public ShapeColorChangeCmd getColorChangeCmd(ShapeDisplayer shape, Color newColor)
    {
        return new ShapeColorChangeCmd(shape,newColor);
    }

    public ShapeCombineCmd getCombineCmd(Iterator<ShapeDisplayer> iter)
    {
        return new ShapeCombineCmd(iter);
    }

    public ShapeResolveCmd getResolveCmd(ShapeDisplayer composite)
    {
        return new ShapeResolveCmd(composite);
    }

    public ShapeExpandCmd getExpandCmd(ShapeDisplayer shape,double multi)
    {
        return new ShapeExpandCmd(shape,multi);
    }

    public ShapeShrinkCmd getShrinkCmd(ShapeDisplayer shape,double multi)
    {
        return new ShapeShrinkCmd(shape,multi);
    }

    public ShapeMoveCmd getMoveCmd(ShapeDisplayer shape,double x,double y)
    {
        return new ShapeMoveCmd(shape,x,y);
    }

    public TextContentChangeCmd getTextChangeCmd(TextDisplayer text,String newContent)
    {
        return new TextContentChangeCmd(text,newContent);
    }
}
